package cn.iocoder.yudao.module.system.controller.admin.mini.other.lottery.dal.dataobject.lottery;

import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.module.system.controller.admin.mini.group.goods.dal.dataobject.groupgoods.GroupGoodsDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
//无用
@TableName("qd_lottery_info")
@Data
public class LotteryInfoDO extends BaseDO {

    /**
     * id主键
     */
    @TableId
    private Integer id;
    /**
     * 拼团订单id
     */
    private Integer groupOrderId;
    /**
     * 拼团商品id
     */
    private Integer groupGoodId;
    /**
     * 拼团商品名称
     */
    private String groupGoodName;
    /**
     * 用户id
     */
    private Integer userId;
    /**
     * 用户头像
     */
    private String avatar;
    /**
     * 用户名称
     */
    private String nickName;
    /**
     * 会员等级
     */
    private String vipLevel;
    /**
     * 奖品名称
     */
    private String prize;
    /**
     * 奖品id
     */
    private Integer prizeId;
    /**
     * 加入时间
     */
    private String addTime;
    /**
     * 是否消耗 1否2是
     */
    private Integer status;
    /**
     * 1劵2奖品
     */
    private Integer type;
    /**
     * 金额
     */
    private BigDecimal price;
    /**
     * 消费订单
     */
    private String buyOrderCode;
    /**
     * 兑换码
     */
    private String code;
    /**
     * 轮盘id
     */
    private Integer tid;
    /**
     * 条形码
     */
    private String barCode;

    /**
     * 商品图片
     */
    @TableField(exist = false)
    private String phone;
    /**
     * 商品图片
     */
    @TableField(exist = false)
    private String mail;

    public LotteryInfoDO() {
    }

    public LotteryInfoDO(LotteryUser user, GroupGoodsDO vo) {
        this.groupGoodId = vo.getId();
        this.groupGoodName = vo.getGoodsName();
        this.userId = 0;
        this.avatar = user.getAvatar();
        this.nickName = user.getNickName();
        this.vipLevel = "金卡会员";
        this.prize = "幸运奖";
        this.prizeId = 5;
        this.addTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));;
    }

    public static void main(String[] args) {
        System.out.println("https://jockers.oss-cn-beijing.aliyuncs.com/20240430/d402c1bd9ce446e7ae5be415fa450804.png".length());
    }
}
